package com.tj.collection.db.dao.impl;

import com.fqgj.common.base.AbstractBaseMapper;
import com.fqgj.common.utils.StringUtils;
import com.tj.collection.db.dao.ClMerchantDao;
import com.tj.collection.db.entity.ClMerchantEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * User: anonymous
 * Date: 2020-12-17
 * Time: 16:17:30.709
 */

@Repository
public class ClMerchantDaoImpl extends AbstractBaseMapper<ClMerchantEntity> implements ClMerchantDao {

    @Override
    public List<ClMerchantEntity> selectAllClMerchantList() {
        return getSqlSession().selectList(this.getStatement("selectAllClMerchantList"));
    }

    @Override
    public ClMerchantEntity selectClMerchantEntityByToken(String token) {
        if (StringUtils.isEmpty(token)) {
            return null;
        }
        Map<String, Object> params = new HashMap<>();
        params.put("token", token);
        return getSqlSession().selectOne(this.getStatement("selectClMerchantEntityByToken"), params);
    }
}